@extends('model/admin')

@section('title','友情链接管理')

@section('content')


<div class="mws-panel grid_8">
	<div class="mws-panel-header">
    	<span><i class="icon-table"></i> 友情链接列表 </span>
    </div>
    <div class="mws-panel-body no-padding">
        <div role="grid" class="dataTables_wrapper" id="DataTables_Table_1_wrapper">

			<form action="/admin/links/index" method='get'>
		    <div id="DataTables_Table_1_length" class="dataTables_length">
		        <label>每页显示<select name="num" size="1" aria-controls="DataTables_Table_1">
		        	<option value="2" @if(!empty($str['num']) && $str['num'] == 2) selected="selected" @endif>2</option>
		        	<option value="5" @if(!empty($str['num']) && $str['num'] == 5) selected="selected" @endif>5</option>
		        	<option value="7" @if(!empty($str['num']) && $str['num'] == 7) selected="selected" @endif>7</option>
		        	<option value="10" @if(!empty($str['num']) && $str['num'] == 10) selected="selected" @endif>10</option>
		       	</select>条数据</label>
		    </div>
		    <div class="dataTables_filter" id="DataTables_Table_1_filter">
		    	<label>链接关键字: <input type="text" aria-controls="DataTables_Table_1" name='search' value="{{$str['search'] or ''}}"></label>
		    	<button class='btn btn-success' >搜 索</button>
		    </div>
			</form>
		   	<table class="mws-datatable-fn mws-table dataTable" id="DataTables_Table_1" aria-describedby="DataTables_Table_1_info">
	            <thead>
	                <tr role="row">
	                	<th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1" style="width:30px;" aria-label="Engine version: activate to sort column ascending" >新闻ID</th>
	                	<th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1" style="width: 40px;" aria-label="Engine version: activate to sort column ascending">新闻类型</th>
	                	<th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1" style="width: 50px;" aria-label="Engine version: activate to sort column ascending">新闻作者</th>
	                	<th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1" style="width: 100px;" aria-label="Engine version: activate to sort column ascending">新闻标题</th>
	                	<th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1" style="width: 130px;" aria-label="CSS grade: activate to sort column ascending" overflow="hidden">新闻内容</th>
	                	<th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1" style="width: 70px;" aria-label="CSS grade: activate to sort column ascending">添加时间</th>
	                	<th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1" style="width:60px;" aria-label="CSS grade: activate to sort column ascending">操作</th>
	                </tr>
	            </thead>
	        
	        	<tbody role="alert" aria-live="polite" aria-relevant="all">
		            @foreach($res as $k => $v)
					@if($k % 2 == 0)
					<tr class="even">
					@else
					<tr class="odd">
					@endif

			                <td class="">{{ $v['id'] }}</td>
			                <td class="">{{ $v['type'] }}</td>
			                <td class="">{{ $v['author'] }}</td>
			                
			                <td class=" ">{{ $v['title'] }}</td>
			                <td class=" " overflow='hidden'>{{ $v['content'] }}</td>
			                
			                <td class="sorting_1">{{ $v['addtime'] }}</td>
			                <td><a href="/admin/news/edit?id={{$v['id']}}">修改</a>　｜　<a href="/admin/news/delete?id={{$v['id']}}">删除</a></td>
			            </tr>

		            @endforeach
	        	</tbody>
	        </table>
	        <div class="dataTables_info" id="DataTables_Table_1_info"></div>
	        <div class="dataTables_paginate paging_full_numbers" id="DataTables_Table_1_paginate">
	        	
	        	<span class="paginate_button" tabindex="0"> {!! $res->appends($str) !!}</span>
	        </div>
	    </div>
    </div>
</div>

@endsection